package algorithm.linear;

/**
 * 链表结点
 * @param <E>
 */
public class Node<E> {
    public E data;
    public Node<E> next;

    /**
     * 构建结点
     * @param data
     * @param next
     */
    public Node(E data, Node<E> next){
        this.data = data;
        this.next = next;
    }

    public Node (E data) {
        this(data,null);
    }

    public Node() {
        this(null,null);
    }

    @Override
    public String toString() {
        return "Node{" +
                "data=" + data +
                ", next=" + next +
                '}';
    }
}
